﻿using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using ScrumManagementTool.domain.interfaces;

namespace ScrumManagementToolUserControls
{
    /// <summary>
    /// Interaction logic for TreeUserControl.xaml
    /// </summary>
    public partial class TreeUserControl
    {
        public TreeUserControl()
        {
            InitializeComponent();
        }

        public void BuildTree(IProject project)
        {
            TreeViewItem projectTreeViewItem = new TreeViewItem();
            projectTreeViewItem.Header = project.Name;

            TreeViewItem productBacklogTreeViewItem = new TreeViewItem();
            productBacklogTreeViewItem.Header = "Product Backlog";

            projectTreeViewItem.Items.Add(productBacklogTreeViewItem);
            tviProjects.Items.Add(projectTreeViewItem);
        }

        public void BuildTree(IList<IProject> projects)
        {
            foreach (var project in projects)
            {
                BuildTree(project);
            }
        }
    }
}
